package com.haixiaoke.saas.common.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @Author qixi
 * @Date 2024/3/5
 **/
public enum OrderStateEnum {

    /**
     * 1.待入住
     */
    ORDER_STATE_TO_BE_SIGNED("1", "待入住"),

    /**
     * 2.签约审核   已废弃
     */
    ORDER_STATE_SIGNED_CHECK("2", "签约审核"),

    /**
     * 3.订单作废
     */
    ORDER_STATE_CANCEL("3", "订单作废"),

    /**
     * 4.超时未签约  已废弃
     */
    ORDER_STATE_OVERTIME("4","超时未签约"),

    /**
     * 5.签署中    已废弃
     */
    ORDER_STATE_sign("5", "签署中"),

    /**
     * 6.签署失败   已废弃
     */
    ORDER_STATE_SIGN_FAIL("6", "签署失败"),

    /**
     * 7.已入住
     */
    ORDER_STATE_SIGNED("7", "已入住"),

    /**
     * 8.退租审核
     */
    ORDER_STATE_REFUND_RENT_AUDIT("8", "退租审核"),

    /**
     * 9.退租中
     */
    ORDER_STATE_REFUND_RENT("9", "退租中"),

    /**
     *  10.协商退租
     */
    ORDER_STATE_NEGOTIATE_REFUND_RENT("10","协商退租"),

    /**
     *   11.到期退租
     */
    ORDER_STATE_EXPIRE_REFUND_RENT("11","到期退租"),

    /**
     * 12.换房审核
     */
    ORDER_STATE_CHANGE_ROOM_AUDIT("12", "换房审核"),

    /**
     * 13.转租审核
     */
    ORDER_STATE_SUBLET_AUDIT("13", "转租审核"),

    /**
     * 14.超时退租中
     */
    ORDER_STATE_OVERTIME_REFUND_RENT("14", "超时退租中"),

    /**
     * 15.续租审核
     */
    ORDER_STATE_RELET_AUDIT("15", "续租审核"),

    /**
     * 101.待付款
     */
    ORDER_STATE_OBLIGATION("101", "待付款"),

    /**
     * 102.取消支付
     */
    ORDER_STATE_CANCEL_PAY("102", "取消支付"),

    /**
     * 103.待入住
     */
    ORDER_STATE_STAY_CHECK_IN("103", "待入住"),
    /**
     * 104.退订中
     */
    ORDER_STATE_UNSUBSCRIBING("104", "退订中"),

    /**
     * 105.退订成功
     */
    ORDER_STATE_UNSUBSCRIBE_SUCCESSFULLY("105", "退订成功"),

    /**
     * 106.已入住
     */
    ORDER_STATE_CHECK_IN("106", "已入住"),

    /**
     * 107.退房中
     */
    ORDER_STATE_CHECKING_OUT("107", "退房中"),

    /**
     * 108.已完成
     */
    ORDER_STATE_COMPLETED("108", "已完成"),

    /**
     * 151.续租-待支付
     */
    ORDER_STATE_RELET_OBLIGATION("151", "待支付"),

    /**
     * 152.续租-已支付
     */
    ORDER_STATE_RELET_HAVE_PAID("152", "已支付"),

    /**
     * 153.续租-取消支付
     */
    ORDER_STATE_RELET_CANCEL_PAY("153", "取消支付"),

    /**
     * 154.续租-已完成
     */
    ORDER_STATE_RELET_COMPLETED("154", "已完成"),

    /**
     * 付款方式 :1.月付;2.一次性
     */
    RENTAL_MODE_MONTH("1", "月付"),

    /**
     * 付款方式 :1.月付;2.一次性
     */
    RENTAL_MODE_DISPOSABLE("2", "一次性"),

    /**
     * 账单生成规则:1.合同月;2.自然月
     */
    BILL_GENERATION_TYPE_CONTRACT("1", "合同月"),


    /**
     * 账单生成规则:1.合同月;2.自然月
     */
    BILL_GENERATION_TYPE_NATURE("2", "自然月");




    @Getter
    @Setter
    String value;

    @Getter
    @Setter
    String label;

    OrderStateEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }

    public static OrderStateEnum from(String value) {
        for (OrderStateEnum cur : OrderStateEnum.values()) {
            if (cur.getValue().equals(value)) {
                return cur;
            }
        }
        return null;
    }

}
